package com.lesson13.template.improve;

/**
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/9/6 21:37
 */
public abstract class SoyaMilk
{
    final void make()
    {
        select();
        if(isTiaoliao()){
            addTiaoLiao();
        }
        soak();
        beat();
    }

    void select()
    {
        System.out.println("选择新鲜黄豆");
    }

    abstract void addTiaoLiao();

    void soak()
    {
        System.out.println("黄豆和配料开始浸泡");
    }

    void beat()
    {
        System.out.println("黄豆和配料打碎");
    }

    //钩子方法，决定是否添加配料
    boolean isTiaoliao(){
        return true;
    }
}
